<template>
    <!--建档资料维护模块 基本信息页面-->
    <div class="baseInfoPage">
        <el-tabs v-model="activeTab" type="border-card" @tab-click="tabClick">
            <el-tab-pane name="first">
                <span slot="label"> 投保人</span>
                <div class="policyRole">
                    <!-- 投保人 表单 -->
                    <el-form :rules="rules" ref="ruleForm" label-width="130px" class="search_container">
                        <el-row>
                            <el-col :span="6" class="position">
                                <el-form-item label="证件号码" prop="secuityno">
                                    <el-input v-model="euad1.secuityno" :disabled="euad1Disabled.secuityno"></el-input>
                                </el-form-item>
                                <div class="plain_btn">
                                    <el-button type="primary" plain :disabled="flag =='N'"  @click="chooseCustomer(euad1,'euad_1')">选择</el-button>
                                </div>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="姓名" prop="surname">
                                    <el-input disabled v-model="euad1.surname"  ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="性别" prop="cltesex">
                                    <el-select disabled v-model="euad1.cltsex"  >
                                        <el-option
                                                v-for="item in sexs"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="出生日期" prop="cltdob">
                                    <el-input disabled v-model="euad1.cltdob" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="投保年龄" prop="anbAtCcd2">
                                    <el-input disabled v-model="euad1.anbAtCcd2" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="婚姻状况" prop="asMar">
                                    <el-select v-model="euad1.asMar" disabled  >
                                        <el-option
                                                v-for="item in asMars"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="国籍" prop="asCoy">
                                    <el-input disabled v-model="euad1.asCoy" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="学历" prop="education">
                                    <el-select v-model="memberinfo1.education" :disabled="flag =='N'"   >
                                        <el-option
                                                v-for="item in educations"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="有20岁及以下子女" prop="is20ChldrnFlg">
                                    <el-select v-model="memberinfo1.is20ChldrnFlg" :disabled="flag =='N'" placeholder="">
                                        <el-option value="" label=""></el-option>
                                        <el-option value="1" label="Y"></el-option>
                                        <el-option value="0" label="N"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="与被保人关系" prop="fmlyreln">
                                    <el-select v-model="euad1.fmlyreln"
                                        :disabled="euad1Disabled.fmlyreln || flag=='N'" @change="fmlyrelnChange" >
                                        <el-option
                                                v-for="item in fmlyrelns"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="工作内容" prop="jobContent">
                                    <el-input disabled v-model="memberinfo1.jobContent" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职业代码" prop="occpcden">
                                    <el-col :span="12"><el-input @change="checkOccpcden" :disabled="euad1Disabled.occpcden || flag =='N'" v-model="euad1.occpcden" ></el-input></el-col>
                                    <el-col :span="12"><el-input class="ml5" disabled v-model="euad1.asOccpname1" ></el-input></el-col>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职等1" prop="asMortcls1">
                                    <el-input v-model="euad1.asMortcls1" disabled ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职等" prop="mortcls">
                                    <el-input v-model="euad1.mortcls" disabled ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="兼职内容" prop="partContent">
                                    <el-input v-model="euad1.partContent" disabled ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="第二职业代码" prop="woccup">
                                    <el-col :span="12"><el-input @change="checkWoccup" v-model="euad1.woccup" :disabled="euad1Disabled.woccup || flag =='N' "></el-input></el-col>
                                    <el-col :span="12"><el-input class="ml5" disabled v-model="euad1.asOccpname2"></el-input></el-col>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职等2" prop="asMortcls2">
                                    <el-input v-model="euad1.asMortcls2" disabled ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <!-- 附加信息 -->
                        <div class="title">
                            <span>投保人附加信息</span>
                        </div>
                        <el-row class="mt20">
                            <el-col :span="6">
                                <el-form-item label="通讯地址" prop="lngaddr01">
                                    <el-input v-model="memberinfo3.lngaddr01" :maxlength="42" :disabled="flag =='N'"  ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="邮编" prop="cltpcode01">
                                    <el-input v-model="memberinfo3.cltpcode01" :disabled="flag =='N'"  ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="电话（H）" prop="asTel">
                                    <el-input disabled v-model="euad1.asTel"   ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="电话（O）" prop="asTel2">
                                    <el-input disabled v-model="euad1.asTel2"   ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="户籍地址" prop="cltaddr01">
                                    <el-input disabled v-model="euad1.asZipname" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="证件类型" prop="crtfType">
                                    <el-select v-model="memberinfo1.crtfType" disabled  >
                                        <el-option
                                                v-for="item in crtfTypes"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="有效期类型" prop="flag01">
                                    <el-select v-model="euad1.flag01" disabled  >
                                        <el-option
                                                v-for="item in flag01s"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

							<el-col :span="6">
							    <el-form-item label="有效期起始日" prop="dateup02">
							        <el-input disabled v-model="euad1.dateup02"></el-input>
							    </el-form-item>
							</el-col>
                             <el-col :span="6">
                                <el-form-item label="有效期截止日" prop="dateup01">
                                    <el-input disabled v-model="euad1.dateup01"></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="服务机构/就读学校" prop="lngaddr02">
                                    <el-input disabled v-model="memberinfo1.lngaddr02"></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="住所" prop="asAddr">
                                    <el-input disabled v-model="euad1.asAddr"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                </div>
            </el-tab-pane>
            <el-tab-pane name="second">
                <span slot="label">被保人</span>
                <div class="policyRole">
                     <!-- 被保人 表单 -->
                    <el-form :rules="rules" ref="ruleForm" label-width="130px" class="search_container">
                        <el-row>
                            <el-col :span="6" class="position">
                                <el-form-item label="证件号码" prop="secuityno">
                                    <el-input v-model="euad2.secuityno" :disabled="euad2Disabled.secuityno || flag == 'N'"></el-input>
                                </el-form-item>
                                <div class="plain_btn">
                                    <el-button type="primary" :disabled="flag =='N'"  plain @click="chooseCustomer(euad2,'euad_2')">选择</el-button>
                                </div>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="姓名" prop="surname">
                                    <el-input disabled v-model="euad2.surname" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="性别" prop="cltsex">
                                    <el-select disabled v-model="euad2.cltsex"   >
                                        <el-option
                                                v-for="item in sexs"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="出生日期" prop="cltdob">
                                    <el-input disabled v-model="euad2.cltdob"  ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="投保年龄" prop="anbAtCcd2">
                                    <el-input disabled v-model="euad2.anbAtCcd2" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="婚姻状况" prop="asMar">
                                    <el-select v-model="euad2.asMar" disabled  >
                                        <el-option
                                                v-for="item in asMars"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="国籍" prop="asCoy">
                                    <el-input disabled v-model="euad2.asCoy" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="学历" prop="education">
                                    <el-select v-model="memberinfo2.education" :disabled="flag =='N'"   >
                                        <el-option
                                                v-for="item in educations"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="工作内容" prop="jobContent">
                                    <el-input disabled v-model="memberinfo2.jobContent" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="行业性质" prop="industry">
                                    <el-input disabled v-model="memberinfo2.industry" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职位" prop="position">
                                    <el-input disabled v-model="memberinfo2.position" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="兼职内容" prop="partContent">
                                    <el-input disabled v-model="memberinfo2.partContent" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="职业代码" prop="occpcden">
                                    <el-col :span="12"><el-input @change="checkOccpcden2" v-model="euad2.occpcden" :disabled="euad2Disabled.occpcden || flag== 'N'"></el-input></el-col>
                                    <el-col :span="12"><el-input class="ml5" disabled v-model="euad2.asOccpname1" ></el-input></el-col>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职等" prop="mortcls">
                                    <el-input disabled v-model="euad2.mortcls" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职等1" prop="asMortcls1">
                                    <el-input disabled v-model="euad2.asMortcls1" ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="第二职业代码" prop="woccup">
                                    <el-col :span="12"><el-input @change="checkWoccup2" v-model="euad2.woccup" :disabled="euad2Disabled.woccup || flag =='N'"></el-input></el-col>
                                    <el-col :span="12"><el-input disabled class="ml5" v-model="euad2.asOccpname2"></el-input></el-col>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="职等2" prop="asMortcls2">
                                    <el-input disabled v-model="euad2.asMortcls2" ></el-input>
                                </el-form-item>
                            </el-col>
                          <el-col :span="6">
                            <el-form-item label="与投保人关系" prop="fmlyreln">
                              <el-select v-model="euad2.fmlyreln" :disabled="euad2Disabled.fmlyreln = true || flag=='N'">
                                <el-option
                                    v-for="item in fmlyrelns"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                </el-option>
                              </el-select>
                            </el-form-item>
                          </el-col>
                        </el-row>

                        <!-- 被保人附加信息 -->
                        <div class="title">
                            <span>被保人附加信息</span>
                        </div>
                        <el-row class="mt20">
                            <el-col :span="6">
                                <el-form-item label="户籍地址" prop="asZipname">
                                    <el-input disabled v-model="euad2.asZipname" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="邮编" prop="cltpcode01">
                                    <el-input disabled v-model="memberinfo2.cltpcode01" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="电话（H）" prop="asTel">
                                    <el-input disabled v-model="euad2.asTel" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="电话（O）" prop="asTel2">
                                    <el-input disabled v-model="euad2.asTel2" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="住所" prop="lngaddr01">
                                    <el-input disabled v-model="memberinfo2.lngaddr01" ></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="证件类型" prop="crtfType">
                                    <el-select v-model="memberinfo2.crtfType" disabled  >
                                        <el-option
                                                v-for="item in crtfTypes"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="有效期类型" prop="flag01">
                                    <el-select v-model="euad2.flag01" disabled  >
                                        <el-option
                                                v-for="item in flag01s"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

							<el-col :span="6">
							    <el-form-item label="有效期起始日" prop="dateup03">
							        <el-input disabled v-model="euad2.dateup02"></el-input>
							    </el-form-item>
							</el-col>
                             <el-col :span="6">
                                <el-form-item label="有效期截止日" prop="dateup01">
                                    <el-input disabled v-model="euad2.dateup01"></el-input>
                                </el-form-item>
                            </el-col>
                             <el-col :span="6">
                                <el-form-item label="服务机构/就读学校" prop="lngaddr02">
                                    <el-input disabled v-model="memberinfo2.lngaddr02"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="服务机构地址" prop="wrkpos">
                                    <el-input disabled v-model="memberinfo2.wrkpos"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6">
                                <el-form-item label="兼职服务机构" prop="lngaddr03">
                                    <el-input disabled v-model="memberinfo2.lngaddr03" ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>

                    </el-form>
                </div>
            </el-tab-pane>
            <!--  第二被保人需求 start -->
            <el-tab-pane name="fourthly" v-if="euad3.secuityno">
              <span slot="label">第二被保人</span>
              <div class="policyRole">
                <!-- 第二被保人 表单 -->
                <el-form :rules="rules" ref="ruleForm" label-width="130px" class="search_container">
                  <el-row>
                    <el-col :span="6" class="position">
                      <el-form-item label="证件号码" prop="secuityno">
                        <el-input v-model="euad3.secuityno" :disabled="euad3Disabled.secuityno || flag == 'N'"></el-input>
                      </el-form-item>
                      <div class="plain_btn">
                        <el-button type="primary" :disabled="flag =='N'"  plain @click="chooseCustomer(euad3,'euad_3')">选择</el-button>
                      </div>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="姓名" prop="surname">
                        <el-input disabled v-model="euad3.surname" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="性别" prop="cltsex">
                        <el-select disabled v-model="euad3.cltsex"   >
                          <el-option
                              v-for="item in sexs"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="出生日期" prop="cltdob">
                        <el-input disabled v-model="euad3.cltdob"  ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="投保年龄" prop="anbAtCcd2">
                        <el-input disabled v-model="euad3.anbAtCcd2" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="婚姻状况" prop="asMar">
                        <el-select v-model="euad3.asMar" disabled  >
                          <el-option
                              v-for="item in asMars"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="国籍" prop="asCoy">
                        <el-input disabled v-model="euad3.asCoy" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="学历" prop="education">
                        <el-select v-model="memberinfo4.education" :disabled="flag =='N'"   >
                          <el-option
                              v-for="item in educations"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="工作内容" prop="jobContent">
                        <el-input disabled v-model="memberinfo4.jobContent" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="行业性质" prop="industry">
                        <el-input disabled v-model="memberinfo4.industry" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="职位" prop="position">
                        <el-input disabled v-model="memberinfo4.position" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="兼职内容" prop="partContent">
                        <el-input disabled v-model="memberinfo4.partContent" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="职业代码" prop="occpcden">
                        <el-col :span="12"><el-input @change="checkOccpcden3" v-model="euad3.occpcden" :disabled="euad2Disabled.woccup || flag== 'N'"></el-input></el-col>
                        <el-col :span="12"><el-input class="ml5" disabled v-model="euad3.asOccpname1" ></el-input></el-col>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="职等" prop="mortcls">
                        <el-input disabled v-model="euad3.mortcls" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="职等1" prop="asMortcls1">
                        <el-input disabled v-model="euad3.asMortcls1" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="第二职业代码" prop="woccup">
                        <el-col :span="12"><el-input @change="checkWoccup3" v-model="euad3.woccup" :disabled="euad2Disabled.woccup || flag =='N'"></el-input></el-col>
                        <el-col :span="12"><el-input disabled class="ml5" v-model="euad3.asOccpname2"></el-input></el-col>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="职等2" prop="asMortcls2">
                        <el-input disabled v-model="euad3.asMortcls2" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="投保人是被保险人二的" prop="fmlyreln">
                        <el-select v-model="euad3.fmlyreln" :disabled="euad3Disabled.fmlyreln = false || flag=='N'">
                          <el-option
                              v-for="item in fmlyrelns"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                  </el-row>

                  <!-- 第二被保人附加信息 -->
                  <div class="title">
                    <span>第二被保人附加信息</span>
                  </div>
                  <el-row class="mt20">
                    <el-col :span="6">
                      <el-form-item label="户籍地址" prop="asZipname">
                        <el-input disabled v-model="euad3.asZipname" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="邮编" prop="cltpcode01">
                        <el-input disabled v-model="memberinfo4.cltpcode01" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="电话（H）" prop="asTel">
                        <el-input disabled v-model="euad3.asTel" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="电话（O）" prop="asTel2">
                        <el-input disabled v-model="euad3.asTel2" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="住所" prop="lngaddr01">
                        <el-input disabled v-model="memberinfo4.lngaddr01" ></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="证件类型" prop="crtfType">
                        <el-select v-model="memberinfo4.crtfType" disabled  >
                          <el-option
                              v-for="item in crtfTypes"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="有效期类型" prop="flag01">
                        <el-select v-model="euad3.flag01" disabled  >
                          <el-option
                              v-for="item in flag01s"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                          </el-option>
                        </el-select>
                      </el-form-item>
                    </el-col>

                    <el-col :span="6">
                      <el-form-item label="有效期起始日" prop="dateup03">
                        <el-input disabled v-model="euad3.dateup02"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="有效期截止日" prop="dateup01">
                        <el-input disabled v-model="euad3.dateup01"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="服务机构/就读学校" prop="lngaddr02">
                        <el-input disabled v-model="memberinfo4.lngaddr02"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="服务机构地址" prop="wrkpos">
                        <el-input disabled v-model="memberinfo4.wrkpos"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="6">
                      <el-form-item label="兼职服务机构" prop="lngaddr03">
                        <el-input disabled v-model="memberinfo4.lngaddr03" ></el-input>
                      </el-form-item>
                    </el-col>
                  </el-row>

                </el-form>
              </div>
            </el-tab-pane>
            <!--  第二被保人需求 end -->
            <el-tab-pane label="受益人" name="third">
                <span slot="label">受益人</span>
                <div class="policyRole">
                    <!-- 操作按钮 -->
                    <el-row>
                        <el-col :span="24" class="pb15 pt15">
                            <el-button @click="addBeneficiary" type="danger" :disabled="flag =='N'"  plain>新增</el-button>
                        </el-col>
                    </el-row>
                    <div class="table_container">
                        <el-table
                            :data="euaes"
                            highlight-current-row
                            header-cell-class-name="table-header-class"
                            style="width:100%">
                            <el-table-column
                            width="130"
                            property="bnycd"
                            label="受益人别"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-select v-model="scope.row.bnycd" :disabled="flag =='N'" @change="checkBnycd(scope)" placeholder="请选择" >
                                        <el-option
                                        v-for="item in bnycds"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                            <el-table-column
                            width="220"
                            property="secuityno"
                            label="证件号码"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-col :span="16"><el-input v-model="scope.row.secuityno" :disabled="flag =='N'"></el-input></el-col>
                                    <el-col :span="8" style="padding-left:5px!important;">
                                        <el-button type="primary" @click="chooseCustomer(scope.row,'euae_'+scope.$index)"
                                            plain :disabled="flag =='N'">选择</el-button>
                                    </el-col>
                                </template>
                            </el-table-column>
                            <el-table-column
                            width="100"
                            property="primaryInsuranceName"
                            label="证件类型"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-select v-model="scope.row.flag01" disabled>
                                        <el-option
                                        v-for="item in crtfTypes"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                            <el-table-column
                            property="seqno"
                            label="顺序"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.seqno"  @change="checkSeqno(scope.row)" :disabled="flag =='N'"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                            property="proportion"
                            label="比例"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.proportion" @change="checkProportion(scope.row)" :disabled="flag =='N'"></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                            width="120"
                            property="surname"
                            label="姓名"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.surname" disabled></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                            width="120"
                            property="fmlyreln"
                            label="关系"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-select v-model="scope.row.fmlyreln" :disabled="flag =='N'">
                                        <el-option
                                        v-for="item in fmlyrelns"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                            <el-table-column
                            width="120"
                            property="cltdob"
                            label="出生日期"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input v-model="scope.row.cltdob" disabled ></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                            width="80"
                            property="cltsex"
                            label="性别"
                            align='center'>
                                <template slot-scope="scope">
                                <el-select v-model="scope.row.cltsex"  disabled >
                                    <el-option
                                    v-for="item in sexs"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                                    </el-option>
                                </el-select>
                            </template>
                            </el-table-column>
                            <el-table-column
                            width="120"
                            property="bnyclt"
                            label="客户号"
                            align='center'>
                                <template slot-scope="scope">
                                    <el-input disabled v-model="scope.row.bnyclt" ></el-input>
                                </template>
                            </el-table-column>
                            <el-table-column
                            property="paymentPeriod"
                            label="操作"
                            align='center'>
                                <template slot-scope="scope">
                                    <span class="operationIcon"
                                         @click="removeBeneficiary(scope.$index, scope.row)">
                                        <!-- 删除操作 -->
                                        <el-tooltip class="item" effect="light" content="删除" >
                                            <i class="el-icon-delete"></i>
                                        </el-tooltip>
                                    </span>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </el-tab-pane>
        </el-tabs>

        <!-- 弹框 证件号码（选择按钮）-->
        <el-dialog
            title="选择客户"
            :visible.sync="secuitynoDialogVisible"
            width="70%"
            :modal="false"
            center>
            <div slot="title">
                <div class="el-dialog__title" style="margin:3px;">选择客户</div>
                <customerInfo ref="imCustomerInfo"></customerInfo>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="xzCustomer">确定</el-button>
                <el-button @click="secuitynoDialogVisible = false">返 回</el-button>
            </span>
        </el-dialog>
    </div>
</template>
<script>
    import constant from '@/utils/constant';
    import { getCustomerInfoDetail } from "@/api/customermanage/customerManage.js";
    import { fCalAssAge,checkOccpcden,checkWoccup,
             checkOccpcden2,checkWoccup2 } from "@/api/policyRecord/materialsMaintain/insurance.js";
    // import pageCall from "@/utils/pageCall";
    export default {
        components: {
            customerInfo: resolve => require(['../../customerManage/customerInfoQuery'], resolve),
        },
        data(){
            return {
                value:'',
                secuitynoDialogVisible:false,
                 rules:{
                 },
                 activeTab: 'first',
                 sexs:[
                    {value:'',label:''},
                    {value:'M',label:'M-男'},
                    {value:'F',label:'F-女'},
                    {value:'U',label:'U-不明'}
                 ],
                asMars:[
                    {value:'',label:''},
                    {value:'S',label:'未婚'},
                    {value:'M',label:'已婚'},
                    {value:'N',label:'不明'},
                    {value:'D',label:'离异'},
                    {value:'W',label:'丧偶'}
                ],
                crtfTypes: [
                    {value:'',label:''},
                    {value:'1',label:'身份证'},
                    {value:'2',label:'护照'},
                    {value:'3',label:'军官证'},
                    {value:'4',label:'港澳回乡证'},
                    {value:'5',label:'其他'},
                    {value:'6',label:'出生证'},
                    {value:'7',label:'户口本'},
                    {value:'8',label:'士兵证'},
                    {value:'9',label:'台胞证'},
                    {value:'A',label:'外国人永久拘留身份证'},
                    {value:'B',label:'港澳居民居住在'},
                    {value:'C',label:'台湾居民居住证'},
                    {value:'D',label:'漏填'}
                ],
                flag01s: [
                    {value:'',label:''},
                    {value:'1',label:'终身'},
                    {value:'2',label:'年期'},
                    {value:'3',label:'缺省'}
                ],
                educations: [
                    {value:'',label:''},
                    {value:'1',label:'研究生'},
                    {value:'2',label:'本/专科'},
                    {value:'3',label:'高中'},
                    {value:'4',label:'其他'}
                ],
                bnycds: [
                    {value:'',label:''},
                    {value: '1',label: '1-满期'},
                    {value: '2',label: '2-还本'},
                    {value: '3',label: '3-身故'},
                    {value: '4',label: '4-配偶身故'},
                    {value: '5',label: '5-子女身故'},
                    {value: '7',label: '7-第二被保人'}
                ],
                fmlyrelns: [
                    {value:'',label:''},
                    {value: '1',label: '1-本人'},
                    {value: '2',label: '2-配偶'},
                    {value: '3',label: '3-子女'},
                    {value: '4',label: '4-兄弟姐妹'},
                    {value: '5',label: '5-父母'},
                    {value: '6',label: '6-其他'},
                    {value: '7',label: '7-法定继承'},
                    {value: '8',label: '8-雇佣'},
                    {value: '9',label: '9-债权人'},
                    {value: 'A',label: 'A-祖父母及外祖父母'}
                ],
                euad1: {},
                euad2: {},
                euaa: {},
                euaes: [],
                memberinfo1: {},
                memberinfo2: {},
                memberinfo3: {},
                insureDataForm: this.insureData,
                customerFlag: '',
                euad1Disabled:{fmlyreln:false,secuityno:true,occpcden:true,woccup:true,
                                height:true,weight:true},
                euad2Disabled:{secuityno:true,occpcden:true,woccup:true,height:true,weight:true},
                // 第二被保人需求
                euad3: {}, memberinfo4: {},
                euad3Disabled:{secuityno:true,occpcden:true,woccup:true,height:true,weight:true}
            }
        },
        props:{
			flag:{
				type:String
			},
            insureData:{
                type: Object
            },
            isPopHide:{
                type: Boolean,
                default: false
            },
            getChildrenData: {
                type: Function
            },
        },
        mounted(){
           this.secuitynoDialogVisible = false;
           this.reloadInsureData(null);
        },
        methods: {
            removeBeneficiary(index,row){
                if(this.flag =='N'){
                    return;
                }
                this.euaes.splice(index,1);
            },
            addBeneficiary(){
                let euae = {
                    "applnum": "","seqno": 0,"bnyclt": "","secuityno": "",
                    "fmlyreln": "","bnycd": "","crtuser": "", "dtecrt": 0,
                    "crttime": 0,"userProfile": "","jobName": "",
                    "datime": "","surname": "","proportion": 0,
                    "cltdob": 0,"cltsex": "","marryd": "",
                    "flag01": "","flag02": "","flag03": "", "flag04": "",
                    "flag05": "","cnt": 0, "ctrycode": "CHN","procflg01": "",
                    "dateup01": 0,"procflg02": "", "procflg03": "","procflg04": "",
                    "procflg05": "","procflg06": "", "procflg07": "", "procflg08": "",
                    "procflg09": "","procflg10": "","procflg11": "","procflg12": "",
                    "procflg13": "","procflg14": "","procflg15": "","procflg16": "",
                    "procflg17": "","procflg18": "","procflg19": "",
                    "procflg20": "","dateup02": 0,"dateup03": 0,"dateup04": 0,
                    "dateup05": 0, "dateup06": 0,"dateup07": 0,"dateup08": 0,
                    "dateup09": 0,"dateup10": 0,"dateup11": 0, "dateup12": 0,
                    "dateup13": 0, "dateup14": 0,"dateup15": 0, "dateup16": 0,
                    "dateup17": 0,"dateup18": 0, "dateup19": 0, "dateup20": 0
                }
                this.euaes.push(euae);
            },
            tabClick(){},
            reloadInsureData(insureData){
                if(insureData != null){
                    this.insureDataForm = insureData;
                }
                this.euaa = this.insureDataForm.euaa;
                this.euad1 = this.insureDataForm.euad1;
                this.euad2 = this.insureDataForm.euad2;
                this.euaes = this.insureDataForm.euaes;
                this.memberinfo1 = this.insureDataForm.memberinfo1;
                this.memberinfo2 =  this.insureDataForm.memberinfo2;
                this.memberinfo3 = this.insureDataForm.memberinfo3;
                // 第二被保人需求 start
                this.euad3 = this.insureDataForm.euad3;
                this.memberinfo4 = this.insureDataForm.memberinfo4;
                // 第二被保人需求 end
                let euabs = this.insureDataForm.euabs;
                this.lif_setEuadByPolpln(euabs);
            },
            getInsureData(){
                return this.insureDataForm;
            },
            fmlyrelnChange(){
                let fmlyreln = this.euad1.fmlyreln;
                let form = this.getChildrenData();
                //this.lif_setEuadByPolpln(form.euabs);
                this.$emit('changeFmlyreln',fmlyreln);
                if(fmlyreln == '1'){
                    this.euad2.secuityno = this.euad1.secuityno;
                    this.euad2.surname = this.euad1.surname;
                    this.euad2.cltsex = this.euad1.cltsex;
                    this.euad2.cltdob = this.euad1.cltdob;
                    this.euad2.asMar = this.euad1.asMar;
                    this.euad2.clntnum = this.euad1.clntnum;
                    this.euad2.asCoy = this.euad1.asCoy;
                    this.euad2.asClttype = this.euad1.asClttype;
                    this.euad2.anbAtCcd2 = this.euad1.anbAtCcd2;
                }
            },
            checkProportion(row){
                if(!(/^[0-9]*$/.test(row.proportion))){
                    this.$message({
                        message: '格式有误，请重新输入数字',
                        type: 'error'
                    });
                    row.proportion = '';
                }
            },
            checkSeqno(row){
                if(!(/^[0-9]*$/.test(row.seqno))){
                    this.$message({
                        message: '格式有误，请重新输入数字',
                        type: 'error'
                    });
                    row.seqno = '';
                }
            },
            trim(val){
                if(val == undefined){
                    return '';
                }
                return val.replace(/(^\s*)|(\s*$)/g, '')
            },
            changeCustomer(customerInfo){
                console.info("取得用户信息",customerInfo);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING', true)
                let params = {
                    customerNo: customerInfo.customerNo
                }
                getCustomerInfoDetail(params).then(res => {
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                    if (res.resultCode == constant.SUCCESS && res.data) {
                        let customer = res.data;
                        let flag = this.customerFlag.split('_');
                        if(flag[0]=='euad'){
                            let oldClntnum1 = this.euad1.clntnum;
                            let oldClntnum2 = this.euad2.clntnum;
                            this.insureDataForm.euad1.oldClntnum = oldClntnum1;
                            this.insureDataForm.euad2.oldClntnum = oldClntnum2;
                            // 第二被保人需求
                            let oldClntnum3 = this.euad3.clntnum;
                            this.insureDataForm.euad3.oldClntnum = oldClntnum3;
                            if(flag[1]=='1'){debugger;
                                this.euad1.secuityno = this.trim(customer.idNo);
                                this.euad1.surname = this.trim(customer.customerName);
                                this.euad1.cltsex = this.trim(customer.sex);
                                this.euad1.cltdob = this.trim(customer.birthday);
                                this.euad1.asMar = this.trim(customer.marryd);
                                this.euad1.clntnum = this.trim(customer.customerNo);
                                this.euad1.asCoy = this.trim(customer.nationality.split('-')[0]);
                                this.euad1.asClttype = this.trim(customer.customerType);
                                this.memberinfo3.lngaddr01 = this.trim(customer.postalAddress);
                                this.memberinfo3.cltpcode01 = this.trim(customer.cltpcode);
                                this.euad1.height = 0;
                                this.euad1.weight = 0;
                                this.euad1.bmi = 0;
                                let pparams = {alDob:this.euad1.cltdob,alEffdate:this.euaa.appldate};
                                fCalAssAge(pparams).then(resp => {
                                    this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                                    if (resp.resultCode == constant.SUCCESS) {
                                        this.euad1.anbAtCcd2 = resp.data;
                                        this.euad1.oldClntnum = oldClntnum1;
                                        this.euad2.oldClntnum = oldClntnum2;
                                        if(this.euad1.fmlyreln == '1'){
                                            this.euad2.secuityno = this.trim(customer.idNo);
                                            this.euad2.surname = this.trim(customer.customerName);
                                            this.euad2.cltsex = this.trim(customer.sex);
                                            this.euad2.cltdob = this.trim(customer.birthday);
                                            this.euad2.asMar = this.trim(customer.marryd);
                                            this.euad2.clntnum = this.trim(customer.customerNo);
                                            this.euad2.asCoy = this.trim(customer.nationality.split('-')[0]);
                                            this.euad2.asClttype = this.trim(customer.customerType);
                                            this.euad2.anbAtCcd2 = this.euad1.anbAtCcd2;
                                            this.euad2.height = 0;
                                            this.euad2.weight = 0;
                                            this.euad2.bmi = 0;
                                        }
                                        this.$emit('reloadAllCom',flag[1]);
                                    }
                                }).catch(err => {
                                    this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                                })
                            }else if(flag[1]=='2'){
                                this.euad2.secuityno = this.trim(customer.idNo);
                                this.euad2.surname = this.trim(customer.customerName);
                                this.euad2.cltsex = this.trim(customer.sex);
                                this.euad2.cltdob = this.trim(customer.birthday);
                                this.euad2.asMar = this.trim(customer.marryd);
                                this.euad2.clntnum = this.trim(customer.customerNo);
                                this.euad2.asCoy = this.trim(customer.nationality.split('-')[0]);
                                this.euad2.height = 0;
                                this.euad2.weight = 0;
                                this.euad2.bmi = 0;
                                let pparams = {alDob:this.euad2.cltdob,alEffdate:this.euaa.appldate};
                                fCalAssAge(pparams).then(resp => {
                                    this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                                    if (resp.resultCode == constant.SUCCESS) {
                                        this.euad2.anbAtCcd2 = resp.data;
                                        this.euad2.oldClntnum = oldClntnum2;
                                        this.$emit('reloadAllCom',flag[1]);
                                    }
                                }).catch(err => {
                                    this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                                })
                            } else if(flag[1]=='3'){
                              this.euad3.secuityno = this.trim(customer.idNo);
                              this.euad3.surname = this.trim(customer.customerName);
                              this.euad3.cltsex = this.trim(customer.sex);
                              this.euad3.cltdob = this.trim(customer.birthday);
                              this.euad3.asMar = this.trim(customer.marryd);
                              this.euad3.clntnum = this.trim(customer.customerNo);
                              this.euad3.asCoy = this.trim(customer.nationality.split('-')[0]);
                              this.euad3.height = 0;
                              this.euad3.weight = 0;
                              this.euad3.bmi = 0;
                              this.euad3.roleflag = "4";
                              let pparams = {alDob:this.euad3.cltdob,alEffdate:this.euaa.appldate};
                              fCalAssAge(pparams).then(resp => {
                                this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                                if (resp.resultCode == constant.SUCCESS) {
                                  this.euad3.anbAtCcd2 = resp.data;
                                  this.euad3.oldClntnum = oldClntnum3;
                                  this.$emit('reloadAllCom',flag[1]);
                                }
                              }).catch(err => {
                                this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                              })
                            }
                        }else if(flag[0]=='euae'){
                            let index = flag[1];
                            this.euaes[index].secuityno = this.trim(customer.idNo);
                            this.euaes[index].flag01 = this.trim(customer.idType);
                            this.euaes[index].surname = this.trim(customer.customerName);
                            this.euaes[index].cltdob = this.trim(customer.birthday);
                            this.euaes[index].cltsex = this.trim(customer.sex);
                            this.euaes[index].bnyclt = this.trim(customer.customerNo);
							//赋值受益人证件有效期，有效期类型，起始，截止等等
							this.euaes[index].procflg01 = this.trim(customer.validityType);
							this.euaes[index].dateup01 = this.trim(customer.validityDate);
							this.euaes[index].dateup02 = this.trim(customer.startValidityDate);
							this.insureDataForm.euaes = this.euaes;
                        }
                        this.secuitynoDialogVisible = false;
                    }
                }).catch(err => {
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING', false)
                })
            },
            chooseCustomer(obj,customerFlag){
                this.customerFlag = customerFlag;
                let readFlag = false;
                if(this.customerFlag =='euad_1'){
                     let dataForm = this.getChildrenData();
                     let clntnum_1 = this.euad1.clntnum;
                     let clntnum_2 = this.euad2.clntnum;
                     let hasPolpln = this.checkHasPolpln(dataForm.euabs,clntnum_2);
                     if(this.euad1.fmlyreln=='1'){
                        if(hasPolpln){
                            readFlag = true;
                        }else{
                            readFlag = false;
                        }
                    }else{
                        hasPolpln = this.checkHasPolpln(dataForm.euabs,clntnum_1);
                        if(hasPolpln){
                            //投保人有险种判断是否是PB,不是PB险种可以修改客户资料
                            let isPb = this.isPbPolpln(dataForm.euabs,clntnum_2);
                            if(isPb){
                                readFlag = true;
                            }else{
                                readFlag = false;
                            }
                        }
                    }
                }else if(this.customerFlag =='euad_2'){
                    let dataForm = this.getChildrenData();
                    let clntnum_2 = this.euad2.clntnum;
                    readFlag = this.checkHasPolpln(dataForm.euabs,clntnum_2);
                    //if(readFlag && this.euad1.fmlyreln == '1'){
                    //    return ;
                    //}
                } else if (this.customerFlag == "euad_3") {
                  let dataForm = this.getChildrenData();
                  let clntnum_3 = this.euad3.clntnum;
                  readFlag = this.checkHasPolpln(dataForm.euabs,clntnum_3);
                }
                this.secuitynoDialogVisible = true;
                let searchParams = {
                    'customerNo': '',
                    'customerName': '',
                    'idNo': obj.secuityno,
                };
                this.$refs.imCustomerInfo.setSearchParams(searchParams);
                if(obj.secuityno){
                    this.$refs.imCustomerInfo.getList(readFlag);
                }
            },
            // 获取从客户查询页面的值
            getData(e){
                console.log(e);
            },
            xzCustomer(){
                let info = this.$refs.imCustomerInfo.getCoustInfo();
                if(info == null){
                     this.$message({
                        message: '请选择客户',
                        type: 'error'
                    });
                    return;
                }
                this.changeCustomer(info);
            },
            checkOccpcden(){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let dataForm = this.getChildrenData();
                let para = {
                    euad1: this.euad1,
                    euabList: dataForm.euabs
                };
                checkOccpcden(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        let data = res.data;
                        if(data != null){
                            if(data.euad1 != undefined){
                                this.euad1 = data.euad1;
                            }
                            if(data.euadpky2Form_occpcden != undefined){
                                this.euad2.occpcden = data.euadpky2Form_occpcden;
                            }
                            if(data.euadpky2Form_asOccpname1 != undefined){
                                this.euad2.asOccpname1 = data.euadpky2Form_asOccpname1;
                            }
                            if(data.euadpky2Form_asMortcls1 != undefined){
                                this.euad2.asMortcls1 = data.euadpky2Form_asMortcls1;
                            }
                            if(data.euadpky2Form_mortcls != undefined){
                                this.euad2.mortcls = data.euadpky2Form_mortcls;
                            }
                            if(data.euabList != undefined){
                                this.$emit('changeEuabs',JSON.stringify(data.euabList));
                            }
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                            }
                        }
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                        // 投保人职业代码变更后进行资料保存
                       // this.checkOccpcdenAfterSaveInsure();
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
/*            checkOccpcdenAfterSaveInsure(){
              pageCall.$emit('checkOccpcdenAfterSaveInsure');
            },*/
            checkWoccup(){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let dataForm = this.getChildrenData();
                let para = {
                    euad1: this.euad1,
                    euabList: dataForm.euabs
                };
                checkWoccup(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        let data = res.data;
                        if(data != null){
                            if(data.euad1 != undefined){
                                this.euad1 = data.euad1;
                            }
                            if(data.euadpky2Form_occpcden != undefined){
                                this.euad2.occpcden = data.euadpky2Form_occpcden;
                            }
                            if(data.euadpky2Form_asOccpname1 != undefined){
                                this.euad2.asOccpname1 = data.euadpky2Form_asOccpname1;
                            }
                            if(data.euadpky2Form_asMortcls1 != undefined){
                                this.euad2.asMortcls1 = data.euadpky2Form_asMortcls1;
                            }
                            if(data.euadpky2Form_mortcls != undefined){
                                this.euad2.mortcls = data.euadpky2Form_mortcls;
                            }
                            if(data.euabList != undefined){
                               this.$emit('changeEuabs',JSON.stringify(data.euabList));
                            }
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                            }
                        }
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
            checkOccpcden2(){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let dataForm = this.getChildrenData();
                let para = {
                    euad2: this.euad2,
                    euabList: dataForm.euabs
                };
                checkOccpcden2(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        let data = res.data;
                        if(data != null){
                            if(data.euad2 != undefined){
                                this.euad2 = data.euad2;
                            }
                            if(data.euabList != undefined){
                                this.$emit('changeEuabs',JSON.stringify(data.euabList));
                            }
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                            }
                        }
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                      // 被保人职业代码变更后进行资料保存
                      // this.checkOccpcdenAfterSaveInsure();
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
            checkOccpcden3(){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let dataForm = this.getChildrenData();
                let para = {
                    euad2: this.euad3,
                    euabList: dataForm.euabs
                };
                checkOccpcden2(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        let data = res.data;
                        if(data != null){
                            if(data.euad2 != undefined){
                                this.euad3 = data.euad2;
                            }
                            if(data.euabList != undefined){
                                this.$emit('changeEuabs',JSON.stringify(data.euabList));
                            }
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                            }
                        }
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                        // 被保人职业代码变更后进行资料保存
                        // this.checkOccpcdenAfterSaveInsure();
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
            checkWoccup2(){
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
                let dataForm = this.getChildrenData();
                let para = {
                    euad2: this.euad2,
                    euabList: dataForm.euabs
                };
                checkWoccup2(para).then(res => {
                    if(res.resultCode == constant.SUCCESS){
                        let data = res.data;
                        if(data != null){
                            if(data.euad2 != undefined){
                                this.euad2 = data.euad2;
                            }
                            if(data.euabList != undefined){
                               this.$emit('changeEuabs',JSON.stringify(data.euabList));
                            }
                            if(data.info != undefined){
                                this.$message({
                                    message: data.info,
                                    type: 'error'
                                });
                            }
                        }
                        this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                    }
                }).catch(err =>{
                    console.log(err);
                    this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                })
            },
            checkWoccup3(){
              this.$store.dispatch('loading/CHNAGE_SUBLOADING',true);
              let dataForm = this.getChildrenData();
              let para = {
                euad2: this.euad3,
                euabList: dataForm.euabs
              };
              checkWoccup2(para).then(res => {
                if(res.resultCode == constant.SUCCESS){
                  let data = res.data;
                  if(data != null){
                    if(data.euad2 != undefined){
                      this.euad3 = data.euad2;
                    }
                    if(data.euabList != undefined){
                      this.$emit('changeEuabs',JSON.stringify(data.euabList));
                    }
                    if(data.info != undefined){
                      this.$message({
                        message: data.info,
                        type: 'error'
                      });
                    }
                  }
                  this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
                }
              }).catch(err =>{
                console.log(err);
                this.$store.dispatch('loading/CHNAGE_SUBLOADING',false);
              })
            },
            checkBnycd(scope){
                let euad3 = this.euad3;
                if (scope.row.bnycd == '7') {
                  if (!euad3 || !euad3.clntnum) {
                    this.$message({
                      message: '无第二被保人相关信息, 无法添加受益人信息',
                      type: 'error'
                    });
                    scope.row.bnycd  = '';
                  }
                }
            },
            checkHasPolpln(euabList,clntnum){
                for(let i = 0 ;i < euabList.length;i++){
                    if(euabList[i].polpln != ''
                        && euabList[i].clntnum == clntnum){
                        return true;
                    }
                }
                return false;
            },
            //判断是否是PB险种
            isPbPolpln(euabList,clntnum){
                for(let i = 0 ;i < euabList.length; i++){
                    if(euabList[i].polpln.indexOf("PB") > 0
                        && euabList[i].clntnum == clntnum){
                        return true;
                    }
                }
                return false;
            },
            //根据投保内容里的险种控制投保人,被保人界面属性只读,更新信息等等
            lif_setEuadByPolpln(euabs){
                let clntnum_1 = this.euad1.clntnum;
                let clntnum_2 = this.euad2.clntnum;
                let fmlyreln = this.euad1.fmlyreln;
                let hasPolpln_1 = this.checkHasPolpln(euabs,clntnum_1);
                let hasPolpln_2 = this.checkHasPolpln(euabs,clntnum_2);
                if(fmlyreln == '1'){//可更改投保人的职业代码
                    if(hasPolpln_2){
                        //this.euad1Disabled.fmlyreln = true;
                        this.euad1Disabled.secuityno = true;
                    }else{
                        //this.euad1Disabled.fmlyreln = false;
                        this.euad1Disabled.secuityno = false;
                    }
                    //投保人的职代码,通讯地址,邮编可读写.身高/体重/bmi只读
                    this.euad1Disabled.occpcden = false;
                    this.euad1Disabled.woccup = false;
                    this.euad1Disabled.height = false;
                    this.euad1Disabled.weight = false;
                    //被保人证件号码,职业代码不可修改.身高/体重/bmi可读写
                    this.euad2Disabled.secuityno = true;
                    this.euad2Disabled.occpcden = true;
                    this.euad2Disabled.woccup = true;
                    this.euad2Disabled.height = false;
                    this.euad2Disabled.weight = false;
                    this.euad2Disabled.bmi = false;
                }else{//非同一人,投/保人都可以修改关系栏位和职业代码
                    if(hasPolpln_2){
                        this.euad2Disabled.secuityno = true;
                    }else{
                        this.euad2Disabled.secuityno = false;
                    }

                    if(hasPolpln_1){
                        if(this.isPbPolpln(euabs,clntnum_1)){
                            this.euad1Disabled.secuityno = true;
                        }else{
                            this.euad1Disabled.secuityno = false;
                        }
                    }else{
                        this.euad1Disabled.secuityno = true;
                    }
                    //投保人可修改关系栏位,职业代码,通讯地址和邮编,身高/体重/Bmi
                    this.euad1Disabled.fmlyreln = false;
                    this.euad1Disabled.occpcden = false;
                    this.euad1Disabled.woccup = false;
                    this.euad1Disabled.height = false;
                    this.euad1Disabled.weight = false;
                    //被保人可修改职业代码,身高/体重/Bmi
                    this.euad2Disabled.occpcden = false;
                    this.euad2Disabled.woccup = false;
                    this.euad2Disabled.height = false;
                    this.euad2Disabled.weight = false;
                }
            }
        },
        watch:{
            isPopHide(e){
                console.log('zisai:'+ e);
                if(e){
                    this.secuitynoDialogVisible = false;
                }
            }
        },
        computed: {
        }
    }
</script>
<style lang="less" scoped>
.baseInfoPage{
     .policyRole{
         .position{
             position: relative;
             .plain_btn{
                position: absolute;
                right: -65px;
                top: 0px;
             }
         }
         .operationIcon{
            border:1px solid #e5e5e5;
            box-shadow:0 0 3px #f9f9f9;
            border-radius: 50%;
            cursor: pointer;
            color: #68a3fc;
            display: inline-block;
            width: 22px;
            height: 22px;
        }
     }
}
</style>
